#ifndef     __COMPR_H
#define     __COMPR_H

#include "../../utils/nocopyable.h"
#include "../../utils/object.h"
#include "../../utils/progress.h"

namespace driver {

class Compr : private utils::NoCopyable {

public:
    //关闭 => 开启延时时间
    static constexpr uint32_t OPEN_DURATION = 180 * 1000;

    Compr();

    uint32_t close_duration() {
        return m_close_prog.duration();
    }

    bool open();

    void close();

    bool is_open() { return m_open_flag; }

private:
    utils::Progress m_close_prog;
    bool m_open_flag = false;
};

inline utils::Object<Compr> compr;

}


#endif
